#!/bin/bash
dumpfile="/var/www/dumps/limits"
rm $dumpfile

echo "Net stats:" > $dumpfile
cat /proc/net/netstat >> $dumpfile
echo "Sock stats:" >> $dumpfile
cat /proc/net/sockstat >> $dumpfile
echo "Conntrack buckets:" >> $dumpfile
cat /proc/sys/net/ipv4/netfilter/ip_conntrack_buckets >> $dumpfile
echo "Maximum Conntrack:" >> $dumpfile
cat /proc/sys/net/ipv4/netfilter/ip_conntrack_max >> $dumpfile
echo "Conntrack count:" >> $dumpfile
cat /proc/sys/net/ipv4/netfilter/ip_conntrack_count >> $dumpfile
echo "Conntrack invalid:" >> $dumpfile
cat /proc/sys/net/ipv4/netfilter/ip_conntrack_log_invalid >> $dumpfile
echo "Maximum open files:" >> $dumpfile
cat /proc/sys/fs/file-max >> $dumpfile
echo "Open files:" >> $dumpfile
sysctl fs.file-nr >> $dumpfile
#echo "Open files2:" >> $dumpfile
#lsof | wc -l >> $dumpfile

chmod 644 $dumpfile
